
app = new Vue({
	el: "#app",
	data() {
		return {
			showPicker: false,
			types: [],
			totalForm: {
				type: '',
			},

		}
	},
	methods: {
		async submit() {
			var href = "../service/brushtestpaper.html?type=" + encodeURI(this.totalForm.type)
			window.location.href = href;
		},
		onConfirm(value) {
			this.totalForm.type = value;
			this.showPicker = false;
		},
		async initTestTypes() {
			try {
				let res = await axios.get('api/test/inittype');
				if (res.code === 200) {
					this.types = res.data
				} else {
					this.$toast("题库大分类取得出错。");
				}
			} catch (e) {
				this.$toast("网络连接异常。");
			}
		},



	},
	async mounted() {
		this.initTestTypes()
	}
});
